
module ethernet_phy_config(
    input               i_clk   ,
    input               i_rst   ,
    output              o_link  ,
    output [1 :0]       o_speed ,

    output              o_mdc   ,
    inout               io_mdio 
);

wire [1 :0]             w_user_op           ;
wire [4 :0]             w_user_phy_addr     ;
wire [4 :0]             w_user_reg_addr     ;
wire [15:0]             w_user_reg_data     ;
wire                    w_user_valid        ;
wire                    w_user_ready        ;
wire [15:0]             w_user_read_data    ;
wire                    w_user_read_valid   ;

mdio_ctrl mdio_ctrl_inst(
    .i_clk              (i_clk              ),
    .i_rst              (i_rst              ),

    .o_link             (o_link             ),
    .o_speed            (o_speed            ),

    .o_user_op          (w_user_op          ),
    .o_user_phy_addr    (w_user_phy_addr    ),
    .o_user_reg_addr    (w_user_reg_addr    ),
    .o_user_reg_data    (w_user_reg_data    ),
    .o_user_valid       (w_user_valid       ),
    .i_user_ready       (w_user_ready       ),
    .i_user_read_data   (w_user_read_data   ),
    .i_user_read_valid  (w_user_read_valid  )
);

mdio_drive mdio_drive_inst(
    .i_clk              (i_clk              ),
    .i_rst              (i_rst              ),

    .o_mdc              (o_mdc              ),
    .io_mdio            (io_mdio            ),

    .i_user_op          (w_user_op          ),//01-W   10-R
    .i_user_phy_addr    (w_user_phy_addr    ),
    .i_user_reg_addr    (w_user_reg_addr    ),
    .i_user_reg_data    (w_user_reg_data    ),
    .i_user_valid       (w_user_valid       ),
    .o_user_ready       (w_user_ready       ),
    .o_user_read_data   (w_user_read_data   ),
    .o_user_read_valid  (w_user_read_valid  )
);

endmodule
